home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Environments / Oberon⁄F™ 1.2 / Preinstalled version / System / Docu / Dates (.txt) < prev    next >
Encoding:
Oberon Document  |  1996-02-15  |  5.3 KB  |  104 lines  |  [oODC/obnF]

  1. Documents.StdDocumentDesc
  2. Documents.DocumentDesc
  3. Containers.ViewDesc
  4. Views.ViewDesc
  5. Stores.StoreDesc
  6. Documents.ModelDesc
  7. Containers.ModelDesc
  8. Models.ModelDesc
  9. Stores.ElemDesc
  10. TextViews.StdViewDesc
  11. TextViews.ViewDesc
  12. TextModels.StdModelDesc
  13. TextModels.ModelDesc
  14. TextModels.AttributesDesc
  15. Helvetica
  16. TextRulers.StdRulerDesc
  17. TextRulers.RulerDesc
  18. TextRulers.StdStyleDesc
  19. TextRulers.StyleDesc
  20. TextRulers.AttributesDesc
  21. Helvetica
  22. Helvetica
  23. Helvetica
  24. Helvetica
  25. Helvetica
  26. Helvetica
  27. Helvetica
  28. Dates
  29. DEFINITION Dates;
  30.     CONST
  31.         monday = 0; tuesday = 1; wednesday = 2; thursday = 3; friday = 4; saturday = 5; sunday = 6;
  32.         short = 0; long = 1; abbreviated = 2;
  33.     TYPE
  34.         Date = RECORD 
  35.             year, month, day: INTEGER
  36.         END;
  37.         Time = RECORD 
  38.             hour, minute, second: INTEGER
  39.         END;
  40.         dateToString: PROCEDURE (d: Date; format: INTEGER; VAR str: ARRAY OF CHAR);
  41.         timeToString: PROCEDURE (t: Time; VAR str: ARRAY OF CHAR);
  42.     PROCEDURE  ValidDate (d: Date): BOOLEAN;
  43.     PROCEDURE  ValidTime (t: Time): BOOLEAN;
  44.     PROCEDURE  GetDate (VAR d: Date);
  45.     PROCEDURE  GetTime (VAR t: Time);
  46.     PROCEDURE  GetEasterDate (year: INTEGER; VAR d: Date);
  47.     PROCEDURE  DayOfWeek (d: Date): INTEGER;
  48.     PROCEDURE  Day (d: Date): LONGINT;
  49.     PROCEDURE  DayToDate (n: LONGINT; VAR d: Date);
  50.     PROCEDURE  DateToString (d: Date; format: INTEGER; VAR str: ARRAY OF CHAR);
  51.     PROCEDURE  TimeToString (t: Time; VAR str: ARRAY OF CHAR);
  52. END Dates.
  53. Module Dates provides basic procedures to work with dates. It covers the Julian calendar up to 10/4/1582 and the Gregorian calendar starting at 10/15/1582. Module Dates can deal with dates from 1/1/1 up to 12/31/9999. The types Date and Time are known to the framework and can be displayed by suitable controls.
  54. CONST monday, tuesday, wednesday, thursday, friday, saturday, sunday
  55. Possible return value of procedure DayOfWeek.
  56. CONST short,  long, abbreviated
  57. Possible value for parameter format of DateToString to specify the format.
  58. TYPE Date
  59. Date information.
  60. year: INTEGER    0001 <= year <= 9999
  61. month: INTEGER    1 <= month <= 12
  62. day: INTEGER    1 <= day <= 31
  63. TYPE Time
  64. Time information.
  65. hour: INTEGER    0 <= hour <= 23
  66. minute: INTEGER    0 <= minute <= 59
  67. second: INTEGER    0 <= second <= 59
  68. PROCEDURE  ValidDate (d: Date): BOOLEAN
  69. Test whether d is a valid date according to the Julian (before 1582) or Gregorian (after 1582) calendar. Dates between 10/5/1582 and 10/14/1582 did not exist and are not valid.
  70. PROCEDURE  ValidTime (t: Time): BOOLEAN
  71. Test whether time t is valid.
  72. PROCEUDRE GetDate (VAR d: Date)
  73. Get the current date.
  74. PROCEDURE GetTime (VAR t: Time)
  75. Get the current time.
  76. PROCEDURE GetEasterDate (year: INTEGER; VAR d: Date)
  77. Get the Easter date of year.
  78. (year > 1582) & (year < 2300)    20
  79. PROCEDURE DayOfWeek (VAR d: Date): INTEGER
  80. Return the weekday of date d.
  81. ValidDate(d)    (not explicitly checked)
  82. result IN {monday .. sunday}
  83. PROCEDURE  Day (d: Date): LONGINT;
  84. For date d, return the number of days since 1/1/1. Day(1/1/1) = 1. 
  85. The difference between two dates in days can be computed with Day(d2) - Day(d1).
  86. ValidDate(d)    (not explicitly checked)
  87. result > 0 & result < 3652062
  88. PROCEDURE  DayToDate (n: LONGINT; VAR d: Date);
  89. Convert the number of days since 1/1/1 into a date.
  90. DayToDate(Day(d1), d2) => d1=d2
  91. n > 0 & n < 3652062    (not explicitly checked)
  92. ValidDate(d) & Day(d) = n
  93. PROCEDURE  DateToString (d: Date; format: INTEGER; VAR s: ARRAY OF CHAR);
  94. Convert the date d into string s. The format of the conversion is specified through the operation system.
  95. Usually, with format=short only numbers are used (e.g. 01/20/95), whereas with format=long the weekday and the month are spelled out (e.g. Thursday, January 2, 1992), and with format=abbreviated the weekday and the month is abbreviated (e.g. Thu, Jan 2, 1992).
  96. PROCEDURE TimeToString (t: Time; VAR s: ARRAY OF CHAR);
  97. Convert the time t into string s. The format of the conversion is specified through the operating system.
  98. TextControllers.StdCtrlDesc
  99. TextControllers.ControllerDesc
  100. Containers.ControllerDesc
  101. Controllers.ControllerDesc
  102. Helvetica
  103. Documents.ControllerDesc
  104.